package com.baizhi.genericity;

/**
 *  定义带多个泛型的泛型类
 * @param <H>
 * @param <W>
 */
public class Person<H,W> {
    private String name;
    private H height;  // 一米八  1.8  180
    private W weight;  //180斤   0.018吨，

    public Person() {
    }

    public Person(String name, H height, W weight) {
        this.name = name;
        this.height = height;
        this.weight = weight;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public H getHeight() {
        return height;
    }

    public void setHeight(H height) {
        this.height = height;
    }

    public W getWeight() {
        return weight;
    }

    public void setWeight(W weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", height=" + height +
                ", weight=" + weight +
                '}';
    }
}
